<script setup>

import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
  HomeFilled

} from '@element-plus/icons-vue'
import { ref } from 'vue';



const  logOut  =()=>{
  localStorage.removeItem("token")
}


const loginUsername  =ref(localStorage.getItem("loginUsername"))
const loginNickname=ref(localStorage.getItem("loginNickname"))



</script>

<template>
  <el-container>
    <el-aside width="200px">
      <h1>云音乐管理系统</h1>



      <el-menu active-text-color="#ffd04b" background-color="cadetblue" class="el-menu-vertical-demo" default-active="2"
        text-color="#fff"  @open="handleOpen" @close="handleClose"   :router="true">
        <el-sub-menu index="1">
          <template #title>
            <el-icon><location /></el-icon>
            <span>音乐工作台</span>
          </template>
          <el-menu-item index="/music">音乐管理</el-menu-item>
          <el-menu-item index="1-2">歌词管理</el-menu-item>
        </el-sub-menu>
        <el-sub-menu index="2">
          <template #title>
            <el-icon><location /></el-icon>
            <span>歌手工作台</span>
          </template>

          <el-menu-item index="2-1">歌手管理</el-menu-item>
          <el-menu-item index="2-2">专辑管理</el-menu-item>
        </el-sub-menu>

      </el-menu>





    </el-aside>
    <el-container>
      <el-header >
        <RouterLink to="/">  <el-icon  class="home"><HomeFilled /></el-icon></RouterLink>
         <div>
          <span  style="color: aliceblue;">{{loginUsername}}</span>
          <span  style="color: aliceblue;">{{loginNickname}}</span>
          
          <RouterLink to="/login" style="color: white;text-decoration: none;font-size: 13px;margin-top: 20px"  @click="logOut"  >安全退出</RouterLink>

         </div> 
     
      </el-header>
      <el-main>
          <router-view/>
      </el-main>
    </el-container>
  </el-container>
</template>
<style scoped>

h1{
  height: 60px;
  color: aliceblue;
  text-align: center;
  line-height: 60px;

}



.el-container {
  height: 100%;

}



.el-aside {
  background-color: cadetblue;
  height: 100%;

}


.el-header {
  background-color: cadetblue;
  height: 60px;
  display: flex;
  justify-content: space-between;

}


.el-menu-item:hover{
  font-size: 14px;
}

.home  {
  color: white;
  font-size: 20px;
  margin-top: 20px;


}
</style>
